package com.ys.timer;

import com.ys.entity.storage.TccLogisticsSadFile;
import com.ys.service.storage.TccLogisticsComprehensiveOrderService;
import com.ys.vo.R;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.List;

/**
 * @Author: fxz
 * @CreateTime: 2025-03-20
 * @Description: 物流服务商api
 * @Version: 1.0
 */
public class TimerLogisticsProvidersDaily {
    private static Logger logger = LoggerFactory.getLogger(TimerLogisticsProvidersDaily.class);

    @Autowired
    private TccLogisticsComprehensiveOrderService tccLogisticsComprehensiveOrderService;


    /**
     * 每天8点获取快驿通C88文件
     * @throws Exception
     */
    @Scheduled(cron = "0 0 8 * * * ")
    public void getfile() throws Exception{
        try {
            logger.info("-------------获取快驿通C88文件开始---------------");
            //查询未获取到C88文件的逻辑
            tccLogisticsComprehensiveOrderService.apiGetC88ByTimerKyt();
            logger.info("-------------获取快驿通C88文件结束---------------");
        }catch (Exception e){
            logger.error("失败："+e.getMessage(),e);
        }

    }

    /**
     * 每天8点获取快驿通追踪编号
     * @throws Exception
     */
    @Scheduled(cron = "0 0 8 * * * ")
    public void getorder() throws Exception{
        try {
            logger.info("-------------获取快驿通追踪编号开始---------------");
            tccLogisticsComprehensiveOrderService.apiGetTrackNoByTimerKyt();
            logger.info("-------------获取快驿通追踪编号结束---------------");
        }catch (Exception e){
            logger.error("失败："+e.getMessage(),e);
        }

    }
}
